#ifndef GPIO_H
#define GPIO_H

#include "at91_ioctl.h"
#include "at91_gpio.h"

#define DEV_PIO "/dev/ztic_gpio"

#define LED1	AT91_PIN_PC10
#define LED2	AT91_PIN_PC11
#define sw1	AT91_PIN_PC15
#define sw2	AT91_PIN_PC14
#define sw3	AT91_PIN_PC13
#define sw4	AT91_PIN_PC12

#define IP_JP	AT91_PIN_PC7

#define LED_ON		0
#define LED_OFF	1
#define LED_UNKNOW	2

void set8402pin( int fd_pio );
void init_IP_JP( int fd_pio );
int gpio_in(int fd, int pin);
void gpio_out(int fd, int pin, int val);
void wr8402(int fd_pio, unsigned char val, unsigned char ch);
void init_led( int fd_pio );
void init_sw( int fd_pio );
int sw_rd(int fd_pio);

#endif
